<template>
  <div>

    <div>
      <el-button-group>
        <el-button type="primary" @click="getRunOrder()">查询未完成订单</el-button>
        <el-button type="primary" @click="getFinOrder()">查询已完成的订单</el-button>

      </el-button-group>
    </div>
  <div>
  <el-table
      :data="allOrder"
      border
      style="width: 100% ; margin: auto">
    <el-table-column
        prop="oid"
        label="订单编号"
        width="100">
    </el-table-column>
    <el-table-column
        prop="starttime"
        label="入住时间"
        width="100">
    </el-table-column>
    <el-table-column
        prop="endtime"
        label="截止时间"
        width="150">
    </el-table-column>
    <el-table-column
        prop="realtime"
        label="离开时间"
        width="100">
    </el-table-column>
    <el-table-column
        prop="rid"
        label="房间号"
        width="100">
    </el-table-column>
    <el-table-column
        prop="eid"
        label="办理员工"
        width="100">
    </el-table-column>
    <el-table-column
        prop="realprice"
        label="交易金额"
        width="100">
    </el-table-column>
    <el-table-column
        prop="status"
        label="订单状态"
        width="100">
    </el-table-column>
    <el-table-column
        prop="remark"
        label="订单备注"
        width="100">
    </el-table-column>
  </el-table>
  </div>

  </div>

</template>

<script>
import instance from "@/untils";

export default {
  name: "ShowOrder",
  data(){
    return{
      allOrder:{},
      cid:null,
      rid:''
    }
  },
  methods:{
    getRunOrder(){
      this.allOrder={}
      instance.get('/order/getRunOrder').then(res=>{
        this.allOrder=res.data.data;
      })
    },
    getFinOrder(){
      this.allOrder={}
      instance.get('/order/getFinOrder').then(res=>{
        this.allOrder=res.data.data;
      })
    }

  }
}
</script>

<style scoped>

</style>